package mysql

import "gorm.io/gorm"

type User struct {
	gorm.Model
	UserName string `gorm:"type:varchar(20);not null;comment:用户名"`
	Mobile   string `gorm:"type:char(11);not null;comment:手机号"`
	Password string `gorm:"type:varchar(36);not null;comment:密码"`
}

func (u *User) GetUserMobileOrName(userName, mobile string) error {
	return DB.Where("user_name = ? or mobile = ?", userName, mobile).Limit(1).Find(&u).Error
}
